/*
 * Project: Java User Group, Chennai
 * Copyright(c) 2010 jugc.in
 * All rights reserved.
 *
 * $Revision $, last modified $Date $ by $Author $
 */
package com.quintilis31.home.common.repository.expense;

import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;

/**
 * The Entity representing the Daily expenses
 *
 * @author    Jothi Shankar Kumar. S
 * @since     1.6
 */
@Entity
@SequenceGenerator(name="Expense_Gen", sequenceName="Expense_Seq")
public class DailyExpense implements Serializable {

    @Id @Column(name="Expense_ID")
    @GeneratedValue(generator = "Expense_Gen")
    private Long expenseId;

    @Column(name="Expense_Name")
    private String expenseName;

    @Column(name="Expense_Amount")
    private double expenseAmount;

    @Column(name="Expense_Date")
    private Date expenseDate;

    @Column(name="Created_Date")
    private Date createdDate;

    @Column(name="Expense_Type")
    private String expenseType;//TODO... use embedded object for this...

    @Column(name="Spent_By")
    private String spentBy;

    @Column(name="Comments")
    private String comments;

    public String getExpenseName() {
        return expenseName;
    }

    public void setExpenseName(String expenseName) {
        this.expenseName = expenseName;
    }

    public Long getExpenseId() {
        return expenseId;
    }

    public void setExpenseId(Long expenseId) {
        this.expenseId = expenseId;
    }

    public double getExpenseAmount() {
        return expenseAmount;
    }

    public void setExpenseAmount(double expenseAmount) {
        this.expenseAmount = expenseAmount;
    }

    public Date getExpenseDate() {
        return expenseDate;
    }

    public void setExpenseDate(Date expenseDate) {
        this.expenseDate = expenseDate;
    }

    public String getExpenseType() {
        return expenseType;
    }

    public void setExpenseType(String expenseType) {
        this.expenseType = expenseType;
    }

    public String getSpentBy() {
        return spentBy;
    }

    public void setSpentBy(String spentBy) {
        this.spentBy = spentBy;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    @Override
    public String toString() {
    	return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

    @Override
    public boolean equals(Object obj) {
    	return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public int hashCode() {
    	return HashCodeBuilder.reflectionHashCode(this);
    }
}
